<!-- author: lizq -->
<!-- date: 2022-06-13 11:11:02 -->
<!-- description: svg -->
<!-- <svg-icon icon="code" class="code" color="red"></svg-icon> -->
<template>
  <svg aria-hidden="true" :class="svgClass">
    <use :xlink:href="symbolId" :fill="color" />
  </svg>
</template>

<script setup>
const props = defineProps({
  prefix: { type: String, default: "icon" },
  icon: { type: String, required: true },
  color: { type: String, default: "" },
  class: { type: String, default: "" }
});

// const symbolId = computed(() => `#${props.prefix}-${props.icon}`);
const symbolId = computed(() => `#${props.icon}`);
const svgClass = computed(() => `svg-icon ${props.class}`);
</script>

<style scoped>
.svg-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  overflow: hidden;
  fill: currentColor;
}
</style>
